home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Bitmap / Sources / Part.r < prev    next >
Encoding:
Text File  |  1996-12-16  |  6.6 KB  |  256 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.r
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #define SystemSevenOrBetter 1            // we want the extended types
  13. #define    SystemSevenOrLater    1            // Types.r uses this variable
  14.  
  15. #include "Types.r"
  16. #include "SysTypes.r"
  17. #include "CodeFragmentTypes.r"
  18.  
  19. #ifndef __ODTYPES_R__
  20. #include "ODTypes.r"
  21. #endif
  22.  
  23. #ifndef FWBLDDEF_H
  24. #include "FWBldDef.h"
  25. #endif
  26.  
  27. #ifndef BINDING_K
  28. #include "Binding.k"
  29. #endif
  30.  
  31. #ifndef DEFINES_K
  32. #include "Defines.k"
  33. #endif
  34.  
  35. //-------------------------------------------------------------------------------------
  36. // CyberDog support
  37. //-------------------------------------------------------------------------------------
  38. // CyberDog is really only supported in Metrowerks builds. Unfortunately,
  39. // we can't detect that we are in Metrowerks REZ or the Metrowerks ODFRC
  40. // plugin, so we always define FW_SUPPORTS_CYBERDOG true for resource
  41. // compiles.
  42. #ifdef FW_SUPPORTS_CYBERDOG
  43. #undef FW_SUPPORTS_CYBERDOG
  44. #endif
  45.  
  46. #define FW_SUPPORTS_CYBERDOG 1
  47.  
  48. #if FW_SUPPORTS_CYBERDOG
  49. // Cyberdog: XXX
  50. #include "Cyberdog.h"
  51. #endif
  52.  
  53. //-------------------------------------------------------------------------------------
  54. // cfrg Resource
  55. //-------------------------------------------------------------------------------------
  56.  
  57. resource 'cfrg' (0) {
  58.     {    /* array memberArray: 2 elements */
  59.         /* [1] */
  60. #ifdef FW_BUILD_MAC68K
  61.         kMotorola,
  62. #else
  63.         kPowerPC,
  64. #endif
  65.         kFullLib,
  66.         kNoVersionNum,
  67.         kNoVersionNum,
  68.         kDefaultStackSize,
  69.         kNoAppSubFolder,
  70.         kIsLib,
  71.         kOnDiskFlat,
  72.         kZeroOffset,
  73.         kWholeFork,
  74.         kODFBitmapEditor,
  75.         /* [2] */
  76. #ifdef FW_BUILD_MAC68K
  77.         kMotorola,
  78. #else
  79.         kPowerPC,
  80. #endif
  81.         kFullLib,
  82.         kNoVersionNum,
  83.         kNoVersionNum,
  84.         kDefaultStackSize,
  85.         kNoAppSubFolder,
  86.         kIsLib,
  87.         kOnDiskFlat,
  88.         kZeroOffset,
  89.         kWholeFork,
  90.         "ODFBitmap"
  91.     }
  92. };
  93.  
  94. //-------------------------------------------------------------------------------------
  95. // NMAP Resources
  96. //-------------------------------------------------------------------------------------
  97.  
  98. resource kODNameMappings (kKindCategoryMapID) {
  99.     kODKind,
  100.     {
  101.         kODFBitmapKind,
  102.         kODIsAnISOStringList
  103.         {
  104.             {
  105.                 kODCategoryPainting
  106.             }
  107.         }
  108.     }
  109. };
  110.  
  111. resource kODNameMappings (kEditorKindMapID) {
  112.     kODEditorKinds,
  113.     {    
  114.         kODFBitmapEditor,
  115.         kODIsAnISOStringList
  116.         {
  117.             {    
  118.                 kODFBitmapKind,
  119.                 // We also know how to read JPEG-compressed photographic images
  120.                 // Note that we don't *externalize* JPEGs, only internalize. For now.
  121.                 kJpegKind
  122. #if FW_SUPPORTS_CYBERDOG
  123.                 ,// Cyber-savvy parts are required to include this kind. It's a hack.
  124.                 kCyberPartKind
  125. #endif
  126.             }
  127.         }
  128.     }
  129. };
  130.  
  131. resource kODNameMappings (kEditorUserStringMapID) {
  132.     kODEditorUserString,
  133.     {    
  134.         kODFBitmapEditor,
  135.         kODIsINTLText
  136.         {
  137.             smRoman, langEnglish, kODFBitmapEditorUserString
  138.         }
  139.     }
  140. };
  141.  
  142. /*
  143.     Kind Strings (kODKindUserString)
  144.     These show up in the Editor Setup control panel, and the Document Info dialog.
  145. */
  146.  
  147. resource kODNameMappings (kKindUserStringMapID) {
  148.     kODKindUserString,
  149.     {    
  150.         kODFBitmapKind, kODIsINTLText {
  151.             smRoman, langEnglish, "Bitmap"
  152.         },
  153.         kJpegKind, kODIsINTLText {
  154.             smRoman, langEnglish, "image/jpeg"
  155.         }
  156.         // We don't specify a user string for kJpegCyberItemKind
  157.     }
  158. };
  159.  
  160. /*
  161.     Icon Mapping (kODKindOldMacOSType)
  162.     We are mapping icon families (MacIcons.rsrc) to OpenDoc kinds.
  163.     
  164.     This has nothing to do with data - unlike normal MacOS documents,
  165.     the OSType on an OpenDoc document is meaningless and does 
  166.     *absolutely nothing* except tell the Finder what icon to use.
  167. */
  168.  
  169. resource kODNameMappings (kOldMacOSTypeMapID) {
  170.     kODKindOldMacOSType,
  171.     {    
  172.         kODFBitmapKind,     kODIsMacOSType { kODFBitmapDocumentOSType },
  173.         kJpegKind,             kODIsMacOSType { 'DFBJ' }
  174. #if FW_SUPPORTS_CYBERDOG
  175.         ,
  176.         kJpegCyberItemKind, kODIsMacOSType { 'uFBJ' }
  177. #endif
  178.     }
  179. };
  180.  
  181. /*
  182.     Importing & Translation (kODEditorPlatformKind)
  183.     This is where we specify foreign data kinds
  184.     In our case we are declaring that we can import:
  185.     Macintosh pictures (via files and drag&drop)
  186.     JPEG images (via files and drag&drop)
  187.     
  188.     It really isn't necessary to import JPEG's via drag&drop since any program
  189.     which exports JPEGs will also export PICT, but it's no trouble.
  190. */
  191.  
  192. resource kODNameMappings (kEditorPlatformKinds) {
  193.     kODEditorPlatformKind,
  194.     {    
  195.         kODFBitmapEditor, kODIsPltfmTypeSpac {
  196.             {
  197.                 kODPlatformFileType, kPICTOSType, smRoman, langEnglish, "Picture File", kODCategoryPainting,
  198.                 kODPlatformDataType, kPICTOSType, smRoman, langEnglish, "Picture Data", kODCategoryPainting,
  199.                 kODPlatformFileType, kJPEGOSType, smRoman, langEnglish, "JPEG File", kODCategoryPainting,
  200.                 kODPlatformDataType, kJPEGOSType, smRoman, langEnglish, "JPEG Data", kODCategoryPainting,
  201.                 kODPlatformFileType, kJFIFOSType, smRoman, langEnglish, "JPEG (JFIF) File", kODCategoryPainting,
  202.                 kODPlatformDataType, kJFIFOSType, smRoman, langEnglish, "JPEG (JFIF) Data", kODCategoryPainting
  203.             }
  204.         }
  205.     }
  206. };
  207.  
  208. //-------------------------------------------------------------------------------------
  209. // kind Resources
  210. //-------------------------------------------------------------------------------------
  211.  
  212. // Kind resources affect the text Finder displays in the
  213. // "kind" column and file info dialog. This feature was
  214. // introduced as part of Macintosh Easy Open.
  215. //
  216. resource 'kind' (1000) {
  217.     kODFBitmapPartEditorOSType,
  218.     0, /* region = USA */
  219.     {
  220.         'shlb', "OpenDoc™ editor"
  221.     }
  222. };
  223.         
  224. resource 'kind' (1001) {
  225.     kODShellSignature,
  226.     0, /* region = USA */
  227.     {
  228.         kODFBitmapDocumentOSType, kODFBitmapEditorUserString" document",
  229.         kODFBitmapStationeryOSType, kODFBitmapEditorUserString" stationery"
  230.     }
  231. };
  232.  
  233. //-------------------------------------------------------------------------------------
  234. // STR resources
  235. //-------------------------------------------------------------------------------------
  236. // The -16397 string will be displayed by Finder when a user
  237. // tries to open the editor shared library. The string should
  238. // give the user a little detail about the part's capabilities
  239. // and enough information to install the part in the correct location.
  240. //
  241. resource 'STR ' (-16397, purgeable) {
  242.     "OpenDoc™ editor\n\nTo work properly, the “ODFBitmap” shared library"
  243.     " should be placed in the Editors folder.  To create a new document, "
  244.     "open a stationery pad."
  245. };
  246.  
  247. //-------------------------------------------------------------------------------------
  248. // Other resources
  249. //-------------------------------------------------------------------------------------
  250.  
  251. include "MacIcons.rsrc" not 'ckid';
  252. include "Image.Pict" not 'ckid';
  253. #if FW_SUPPORTS_CYBERDOG
  254. include "FWSaveAs.rsrc" not 'ckid';
  255. #endif
  256.